package com.laizhenghua.share.user.api;

import com.laizhenghua.share.common.core.constant.ServiceNameConstants;
import com.laizhenghua.share.common.core.domain.R;
import com.laizhenghua.share.user.api.domain.entity.UserInfo;
import com.laizhenghua.share.user.api.factory.RemoteUserServiceFallbackFactory;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * TODO
 *
 * @Description
 * @Author laizh
 * @Date 2025/10/13 21:38
 **/
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.USER_SERVICE, fallbackFactory = RemoteUserServiceFallbackFactory.class)
public interface RemoteUserService {
    @Operation(summary = "微信小程序授权登录")
    @GetMapping("/user-info/wx/login/{code}")
    R<UserInfo> wxLogin(@PathVariable("code") String code);

    @Operation(summary = "微信小程序注销")
    @GetMapping("/user-info/wx/logout")
    R<String> wxLogout();

    @Operation(summary = "是否免押金判断")
    @GetMapping("/user-info/free/deposit")
    R<Boolean> isFreeDeposit();

    @Operation(summary = "获取用户详细信息")
    @GetMapping(value = "/user-info/get/{id}")
    R<UserInfo> getUserInfo(@PathVariable("id") Long id);
}
